/**
 * 
 */

package com.shy.portal.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.shy.base.dao.impl.BaseDaoImpl;
import com.shy.base.vo.EntityTypeValue;
import com.shy.base.vo.PagerFilter;
import com.shy.base.vo.QueryResult;
import com.shy.portal.dao.RoleDao;
import com.shy.portal.entity.Role;

/**
 * <p>
 * Title: RoleDaoImpl
 * </p>
 * <p>
 * Description:角色管理dao层实现
 * </p>
 * <p>
 * Company:ipebg
 * </p>
 * 
 * @author H2013788
 */
@Repository("roleDao")
public class RoleDaoImpl extends BaseDaoImpl<Role> implements RoleDao {

    @Override
    public PagerFilter listRoleByPager(String whereHql, List<EntityTypeValue> params,
            PagerFilter pagerFilter) {
        Integer firstStart = Integer.parseInt(pagerFilter.getStart() + ""); // 分页开始下标
        Integer showNum = Integer.parseInt(pagerFilter.getMax() + ""); // 显示条数
        QueryResult<Role> result = this.getScrollDataBindName(firstStart, showNum, whereHql,
                params, pagerFilter.getOrderby());
        if (result != null) {
            pagerFilter.setTotal(result.getTotalrecord());
            pagerFilter.setObjs(result.getResultlist());
        }
        return pagerFilter;
    }

}
